<div id="tracking-content">
    <div class="tracking-left" id="scale2">
        <?php if ($this->ships->count() > 0): ?>
            <?php foreach ($this->ships as $ship): ?>
                <div class="tracking-ship-wrapper">
                    <div class="tracking-thumb">
                        <?php if ($ship['vessel_on_arrival']) : ?>
                            <img src="<?php echo UPLOAD_URL . $ship['vessel_on_arrival'] ?>" width="100%" height="50px">
                        <?php else: ?>
                            <img src="<?php echo $this->baseUrl() ?>/public/images/input_ship.jpg" width="100%" height="50px">
                        <?php endif; ?>
                    </div>
                    <div class="tracking-detail">
                        <h1><?php echo $ship['vessel'] ?></h1>

                        <p>Port: <?php echo $ship['port_name'] ?></p>

                        <p>ATA: <?php Core_Util::renderDate($ship['ata']) ?></p>

                        <p>ATS: <?php Core_Util::renderDate($ship['ats']) ?></p>
                    </div>
                    <div class="tracking-button">
                        <a href="<?php echo $this->baseUrl() ?>/service/detail/giid/<?php echo $ship['id'] ?>">
                            <input type="submit" class="button" value="View detail"/>
                        </a>
                    </div>
                </div>
            <?php endforeach; ?>
        <?php endif; ?>
        <center>
            <div class="paging">
                <?php echo $this->paginationControl($this->paginator, "Sliding", "/_partial/paginator.phtml") ?>
            </div>
        </center>
    </div>
    <div class="hidden" id="showhide">
        <div class="tracking-right">
            <form method='GET' action="<?php $this->baseUrl() ?>/tracking">
                <div class="elements">
                    <div class="f-name">Ref No.</div>
                    <div class="reselect">
                        <input type="text" class="refine" id="ref_no" name='ref_no' placeholder="Enter text..."
                               value="<?php echo $this->filters['ref_no'] ?>"/>
                    </div>
                </div>
                <div class="elements">
                    <div class="f-name">Vessel</div>
                    <div class="reselect">
                        <input type="text" class="refine" id="vessel" placeholder="Enter text..." name="vessel"
                               value="<?php echo $this->filters['vessel'] ?>"/>
                    </div>
                </div>
                <div class="elements">
                    <div class="f-name">Port of call</div>
                    <div class="reselect">
                        <select name="port_of_call" id="ddlOne" class="refine">
                            <option value='0'>-- Select Port --</option>
                            <?php foreach ($this->ports as $port): ?>
                                <option
                                    value="<?php echo $port->id ?>" <?php echo $this->filters['port_of_call'] == $port->id ? "selected" : "" ?>><?php echo $port['name'] ?></option>
                                <?php endforeach; ?>
                        </select>
                    </div>
                </div>
                <div class="elements">
                    <div class="f-name">ATA</div>
                    <div class="reselect">
                        <input type="text" class="refine datetime" id="ata" placeholder="dd/mm/yy" name='ata'
                               value='<?php echo!empty($this->filters['ata']) ? Core_Util::renderDate($this->filters['ata']) : "" ?>'/>
                    </div>
                </div>
                <div class="elements">
                    <div class="f-name">ATS</div>
                    <div class="reselect">
                        <input type="text" class="refine datetime" id="ats" placeholder="dd/mm/yy" name='ats'
                               value='<?php echo!empty($this->filters['ats']) ? Core_Util::renderDate($this->filters['ats']) : "" ?>'/>
                    </div>
                </div>
                <div class="elements">
                    <div class="f-name">&nbsp;</div>
                    <div class="reselect">
                        <input type="submit" class="button" value="Search" />
                        <input type="button" class="button" value="Cancel" onclick="toggleShowHide()"/>
                    </div>
                </div>
            </form>
            <div style="clear: both;">&nbsp;</div>
        </div>
    </div>

    <div style="clear: both;">&nbsp;</div>
</div>
<script type="text/javascript" src="<?php echo $this->baseUrl() ?>/public/js/jquery-1.10.0.min.js"></script>  
<script type="text/javascript">
    function toggleShowHide() {
        $("#showhide").toggle();
    }
    var date_format = 'dd/mm/yy';
</script> 
<script src='<?php echo $this->baseUrl() ?>/public/js/tracking.js'></script>
<link rel='stylesheet' type='text/css' href='<?php echo $this->baseUrl() ?>/public/css/jquery-ui/jquery-ui-1.10.3.css'/>
<script src='<?php echo $this->baseUrl() ?>/public/js/jquery-ui-1.10.3.js'></script>